import 'package:equatable/equatable.dart';
import 'package:meta/meta.dart';

/// 定时器状态
@immutable
abstract class TimerState extends Equatable{
  /// 时间
  final int duration;

  /// 构造方法 
  const TimerState(this.duration);

  @override
  List<Object> get props => [duration];
}

/// 准备状态
class Ready extends TimerState {
  const Ready(int duration) : super(duration);

  @override
  String toString() => 'Ready { duration: $duration }';
}

/// 暂停状态
class Paused extends TimerState {
  const Paused(int duration) : super(duration);
  
  @override
  String toString() => 'Paused { duration: $duration }';
}

/// 运行状态
class Running extends TimerState {
  const Running(int duration) : super(duration); 
  
  @override
  String toString() => 'Running { duration: $duration }';
}

/// 完成状态
class Finished extends TimerState{
  const Finished() : super(0);
}